<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let xb = prompt('请输入你的性别')
        let nl = prompt('请输入你的年龄')
        if (xb == "男" && nl >= 60 && nl <= 100) {
            alert("退休了" + (nl - 60) + "年")
        } else if (xb == "男" && nl < 60 && nl > 0) {
            alert("还差" + (60 - nl) + "年退休")
        } else if (xb == "女" && nl >= 55 && nl <= 100) {
            alert("退休了" + (nl - 55) + "年")
        } else if (xb == "女" && nl < 55 && nl > 0) {
            alert("还差" + (55 - nl) + "年退休")
        } else {
            alert("输入有误")
        }
    </script>
</body>

</html>